package ClassesBasicas;

import java.util.ArrayList;
import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;


@Entity
@Table(name = "laboratorio")
public class Laboratorio {
	
	@Column (name="nome")
	private String nome;
	
	@OneToMany(mappedBy="codigo", cascade=CascadeType.ALL,fetch = FetchType.LAZY)
	private List<Exames> exames;
	
	@Id
	@GeneratedValue
	@Column (name="codigo")
	private int codigo;
	
	public Laboratorio(){	
		this.nome = null;
		this.codigo = 0;
	}	
	public Laboratorio(String nome,ArrayList<Exames> exame) {
		super();
		this.nome = nome;
		this.exames=exame;
	}
	public String getNome() {
		return nome;
	}
	public void setNome(String nome) {
		this.nome = nome;
	}
	public int getCodigo() {
		return codigo;
	}
	public void setCodigo(int codigo) {
		this.codigo = codigo;
	}
	public List<Exames> getExames() {
		return exames;
	}
	public void setExames(List<Exames> exames) {
		this.exames = exames;
	}
}
